/************************************/
/* This code creates the scatterplot in figure 1*/
/* revised JBS July 2005*/
/************************************/


 use transtemp.dta 

* create issue area variable 

gen msissuearea=1 if epms==1
replace msissuearea=2 if fiscal==1
replace msissuearea=3 if cohesion==1
replace msissuearea=4 if employ==1
replace msissuearea=5 if environ==1
replace msissuearea=6 if asylum==1
replace msissuearea=7 if foreign==1
replace msissuearea=8 if other==1
gen ia2=msissuearea

gen mspos= (b+dk+d+gr+e+f+irl+i+lux+nl+a+p+sf+s+uk)/15

bys msissuearea: egen aveam= mean(am) 
bys msissuearea: egen avemspos= mean(mspos)

collapse aveam avemspos msissuearea, by(ia2)
gen mslabel="European Parliament" if msissuearea==1
replace mslabel="Fiscal" if msissuearea==2
replace mslabel="Cohesion" if msissuearea==3
replace mslabel="Employment" if msissuearea==4
replace mslabel="Environment" if msissuearea==5
replace mslabel="Asylum" if msissuearea==6
replace mslabel="Foreign" if msissuearea==7
replace mslabel="Other" if msissuearea==8

reg aveam avemspos

gen mlabpos=3
replace mlabpos=12 if mslabel=="Foreign"
replace mlabpos=9 if mslabel=="Employment"
replace mlabpos=7 if mslabel=="Asylum"

twoway (scatter aveam avemspos, mlabel(mslabel) mlabvp(mlabpos) text(.15 .54 "Regression equation" "y=-.23+1.39x" "r2=.64", size(small))) (lfit aveam avemspos, scheme(s1mono) legend(off) ytitle(percent issues included in treaty) xtitle(percent issues supported by the average member state))  

